package com.mew.common.enm;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;


public enum StrategyType {
    Special(0, "特殊或没有"),

    ControlUser(10, "个控"),
    ControlRoom(11, "房间控制"),
    ControlSpecial(12, "特殊控制"),

    Balance(20, "平衡策略"),
    SmallWave(21, "小波策略"),
    BigWave(22, "大波策略"),

    Ceiling(30, "天花板"),
    PayMaxTimes(31, "充值最大次数")
    ;

    private final static Map<Integer, StrategyType> stateMap
            = Arrays.stream(StrategyType.values()).collect(Collectors.toMap(StrategyType::code, code -> code));

    private final int code;
    private final String desc;


    StrategyType(final int code, final String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int code() {
        return this.code;
    }


    public static StrategyType parse(int code) {
        return stateMap.get(code);
    }

    public String desc(){
        return this.desc;
    }
}
